package com.lujianfei.ann.network.activate;

/**
 * 缺点：
 * 1.会有梯度弥散
 * 2.不是关于原点的函数
 * 3.计算exp比较耗时
 * 
 * @author lujia
 *
 */
public class Sigmoid implements IActivateFunc {

	@Override
	public double f(double x) {
		return 1d / ( 1d + Math.exp(-x) );
	}

	@Override
	public double df(double y) {
		return y * (1d - y);
	}

}
